<template>
  <div class="home">
    <el-row :gutter="20">
      <!-- 下载功能卡片 -->
      <el-col :span="8">
        <el-card class="feature-card" @click="$router.push('/download')">
          <template #header>
            <div class="card-header">
              <el-icon><Download /></el-icon>
              <span>内容下载</span>
            </div>
          </template>
          <div class="card-content">
            <p>从各个平台批量下载内容</p>
          </div>
        </el-card>
      </el-col>

      <!-- 文件浏览器卡片 -->
      <el-col :span="8">
        <el-card class="feature-card" @click="$router.push('/file-explorer')">
          <template #header>
            <div class="card-header">
              <el-icon><Folder /></el-icon>
              <span>文件浏览器</span>
            </div>
          </template>
          <div class="card-content">
            <p>浏览和管理下载的文件</p>
          </div>
        </el-card>
      </el-col>

      <!-- 文件预览卡片 -->
      <el-col :span="8">
        <el-card class="feature-card" @click="$router.push('/preview')">
          <template #header>
            <div class="card-header">
              <el-icon><Document /></el-icon>
              <span>文件预览</span>
            </div>
          </template>
          <div class="card-content">
            <p>快速预览文件内容</p>
          </div>
        </el-card>
      </el-col>

      <!-- 历史记录卡片 -->
      <el-col :span="8">
        <el-card class="feature-card" @click="$router.push('/history')">
          <template #header>
            <div class="card-header">
              <el-icon><List /></el-icon>
              <span>历史记录</span>
            </div>
          </template>
          <div class="card-content">
            <p>查看下载历史记录</p>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script lang="ts" setup>
import { Download, Folder, Document, List } from '@element-plus/icons-vue'
</script>

<style lang="scss" scoped>
.home {
  padding: 20px;

  .feature-card {
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s;

    &:hover {
      transform: translateY(-5px);
      box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
    }

    .card-header {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 16px;
      font-weight: bold;

      .el-icon {
        font-size: 20px;
      }
    }

    .card-content {
      padding: 20px 0;
      text-align: center;
      color: #666;
    }
  }
}
</style>